package bluerain.io.activity.ui;

import android.app.LauncherActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ArrayAdapter;

import bluerain.io.activity.R;

/**
 * Created by foredawn on 15-9-11.
 * LauncherActivity基本用法
 */
public class LauncherActivityTest extends LauncherActivity {

    Class<?>[] activities = new Class[]{
            Activity01.class,
            Activity02.class
    };

    @Override
    protected void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        String[] array = new String[]{"启动第一个", "启动第二个"};
        ArrayAdapter<String> adapter =
                new ArrayAdapter<>(
                        LauncherActivityTest.this,
                        R.layout.support_simple_spinner_dropdown_item,
                        array
                );
        setListAdapter(adapter);

    }

    @Override
    protected Intent intentForPosition(int position) {
        return new Intent(LauncherActivityTest.this, activities[position]);
    }
}
